import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, Matches } from 'class-validator';

export class ResetPasswordDto {
  @IsNotEmpty({ message: 'id不能为空' })
  @ApiProperty({ description: '账号id', example: 5 })
  id: number;

  @Matches(/^(?=.*[a-zA-Z])(?=.*\d).{8,16}$/, {
    message: '请输入8-16位数字+字母的密码',
  })
  @IsNotEmpty({ message: '新密码不能为空' })
  @ApiProperty({ description: '新密码', example: 'admin123' })
  newPassword: string;

  @IsNotEmpty({ message: '确认密码不能为空' })
  @ApiProperty({ description: '确认密码', example: 'admin123' })
  confirmPassword: string;
}
